package com.xyzwps.lib.openapi.element;

import java.util.HashMap;
import java.util.Map;

public class RequestBody implements OASElement {

    private String description;
    private boolean required;
    private final Map<String, MediaType> content = new HashMap<>();

    public String description() {
        return description;
    }

    public boolean required() {
        return required;
    }

    public Map<String, MediaType> content() {
        return content;
    }

    public RequestBody addToContent(String name, MediaType mediaType) {
        content.put(name, mediaType);
        return this;
    }

    public RequestBody description(String description) {
        this.description = description;
        return this;
    }

    public RequestBody required(boolean required) {
        this.required = required;
        return this;
    }

    @Override
    public void accept(OAEVisitor visitor) {
        visitor.visit(this);
    }
}
